import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// const HelloWorld = resolve => {
//     require.ensure(['components/HelloWorld.vue'], () => {
//         resolve(require('components/HelloWorld.vue'))
//     }, 'HelloWorld')
// }
const Home = resolve => {
  require.ensure(['components/home/Home.vue'], () => {
    resolve(require('components/home/Home.vue'))
}, 'Home')
}
const Main = resolve => {
    require.ensure(['components/main/Main.vue'], () => {
        resolve(require('components/main/Main.vue'))
    }, 'Main')
}
export default new Router({
  routes: [
    // {
    //   name: 'HelloWorld',
    //   path: '/',
    //   component: HelloWorld
    // },
    {
      name: 'Home',
      path: '/',
      component: Home
    },
    {
      name: 'Main',
      path: '/main',
      component: Main
    }
  ]
})
